import axios from 'axios';
import config from './config';

const fetchConfig = config.fetch;

const instance = axios.create({
  ...fetchConfig,
});

instance.interceptors.response.use((response) => {
  if (response.status === 200) {
    return response.data;
  }
}, (error) => Promise.reject(error));

export default instance;
